<?php
/*
 * 大赛-判断是否可以上传
 * 传入参数 
 * 2014-02-20
 */
include "inc/public_header.php";
include "func/user.php";				//用户信息处理函数

 //获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0","msg"=>"没有获取到用户信息"));
	die;
}
$uid 			= $uInfoArr["uid"];				//用户信息主键

$hd_id			= $_REQUEST["hd_id"];			//活动主键
//$uid			= $_REQUEST["uid"];			//活动主键




$reJson = array();//构建返回值

$reJson["success"] = "1";

$sql="select uploadType from new_weituo_huodong where id='".$hd_id."'";
$db->query($sql);
$db->next_record();
$uploadType = $db->f("uploadType"); //大赛总数
if($uploadType==0){
	$sql="	select a.year as year
				from new_weituo_person a
					INNER JOIN user_base b on a.uid=b.uid
				WHERE b.uid='".$uid."'";
	$db2->query($sql);
	$db2->next_record();			
	if(!$db2->f("year")){
		echo json_encode(array("success"=>"1","canUpload"=>"0"));
		die;
	}
	else{
		$reJson["canUpload"] = "1";
	}
}
else if ($uploadType==1){
	$reJson["canUpload"] = "1";
}
/**

**/
echo json_encode($reJson);
?>
